projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cc6db27
)
grid: avoid a floating point exception
author
Matthias Clasen
<mclasen@redhat.com>
Sat, 24 Mar 2012 21:16:47 +0000
(17:16 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Sat, 24 Mar 2012 21:19:46 +0000
(17:19 -0400)
When a homogeneous grid has no visible children, we were
accidentally doing a division by zero. Instead, just bail
out early in this case, there is nothing to allocate anyway.
https://bugzilla.gnome.org/show_bug.cgi?id=672763
gtk/gtkgrid.c
patch
|
blob
|
history
diff --git
a/gtk/gtkgrid.c
b/gtk/gtkgrid.c
index fdbdf7c147501086ac1a962dac26ea4c72554560..8a96e827517de31a96a0d6e93aaa2785e84003ba 100644
(file)
--- a/
gtk/gtkgrid.c
+++ b/
gtk/gtkgrid.c
@@
-1020,6
+1020,9
@@
gtk_grid_request_allocate (GtkGridRequest *request,
gtk_grid_request_compute_expand (request, orientation, &nonempty, &expand);
+ if (nonempty == 0)
+ return;
+
linedata = &priv->linedata[orientation];
lines = &request->lines[orientation];